<script type="text/javascript" language="javascript">
var xmlHttp //Ambil XML HTTP untuk berbagai browser
function GetXmlHttpObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 //Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}
// ================================================================================== showKab(str) == start
function showKab(str)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
	var url="<?php echo site_url().'kabupaten/ajax_showKab'?>";
	url=url+"/"+str;
	//alert(url);
	//url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
 } 
}
// ================================================================================== showKab(str) == finish
</script>

<div class="content">
<h2><?php echo $title ?></h2>
	<label>Pilih Provinsi : </label>
	<?php echo provDropdown($id_prov)?>
<div id="txtHint">
<p id="bottom_link"><a class="add" href="<?php echo site_url().'kabupaten/add/'.$id_prov?>">Tambah Kabupaten/Kota</a></p>
<table border="0" cellpadding="0" cellspacing="0">
	<tr>
		<th><div align="center">No</div></th>
		<th><div align="center">Nama Kabupaten</div></th>
		<th><div align="center">Aksi</div></th>
	</tr>

<?php 
$i = 1 ;
foreach($query as $row):  ?>
	<tr class="<?php if ($i %2 == 0):echo "zebra";else:echo "zebra2"; endif;?>"> 
		<td><?php echo $i?></td>
		<td><?php echo $row['nama_kab']; ?></td>
		<td><div class="action"><a class="update" href="<?php echo site_url().'kabupaten/edit/'.$row['id_kab'].'/'.$row['id_provinsi']?>">Edit</a> 
		<a class="delete" href="<?php echo site_url().'kabupaten/delete/'.$row['id_kab'].'/'.$row['id_provinsi']?>">Hapus</a></div></td>
	</tr>
<?php 
$i++;
endforeach;?>
</table>
</div>
</div>